package per.zdb.watcher.activities;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.Toast;

import butterknife.ButterKnife;

/**
 * Created by Adobe Chow  2017/9/24.
 * Copyright © 2017 zdb Inc. All Rights Reserved.
 */

public abstract class BaseActivity extends Activity {
    public abstract int getContentViewId();
    protected abstract void initAllMembersView(Bundle savedInstanceState);

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentViewId());
        ButterKnife.bind(this);
        initAllMembersView(savedInstanceState);
    }

    public void log(String msg){
        Log.i("zdb log",msg);
    }

    public void showLongToast(String msg){
        Toast.makeText(this,msg,Toast.LENGTH_LONG).show();
    }
    public void showShortToast(String msg){
        Toast.makeText(this,msg,Toast.LENGTH_SHORT).show();
    }
}
